package cn.edu.imnu.Controller;

import cn.edu.imnu.Service.DashboardService;
import cn.edu.imnu.entity.Result;
import cn.edu.imnu.entity.vo.Statsvo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    // 统计卡片接口
    @GetMapping("/stats")
    public Result<List<Statsvo>> getDashboardStats() {
        List<Statsvo> stats = dashboardService.getDashboardStats();
        return Result.success(stats);
    }
    @GetMapping("/levelcount")
    public Result<List<Map<String, Object>>> getDoctorsCountByLevel() {
        List<Map<String, Object>> stats = dashboardService.getDoctorsCountByLevel();
        return Result.success(stats);
    }
}